#demo default parameters passing - call-by-value.
 
#The my operator is also used to turn on call-by-value 
#and is said to be lexically scoped. Unlike the variables 
#declared with the local function, any variables declared 
#as my variables are visible only within the subroutine in 
#which they are declared, not in any subroutines called from 
#this subroutine. If more than one variable is listed, the 
#list must be enclosed in parentheses. 

sub greet
{
	my ($fname, $lname) = @_; #turn on "call-by-value".
	$fname = "wang";
	print "$fname - $lname\n" ;
}

my $first = "Zhao" ;
my $last  = "Yang" ;

greet ( $first, $last) ;
print "$first - $last\n";
